<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能图书平台）</title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
    <style>

  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(-15px);
    }
    60% {
      transform: translateY(-10px);
    }
  }

  .bounce {
    animation: bounce 0.6s;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #5B86E5, #36D1DC); /* 添加渐变背景色 */
  }

  .container {
    width: 30%;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  input[type="text"], input[type="password"], input[type="tel"] {
    width: 100%;
    margin-bottom: 20px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
  }

  .password-confirm {
    position: relative;
    width: 100%;
  }
  .password-status {
    position: absolute;
    right: 35px;
    top: 30%;
    transform: translateY(-50%);
    font-size: 24px;
  }
  .hidden {
    display: none;
  }
  button {
    padding: 10px 20px;
    background-color: #3f51b5;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s; /* 添加过渡效果 */
  }
  button:hover {
    background-color: #303f9f;
  }

    </style>
</head>
<body>
<div class="container">
    <div id="message" hidden="true">{{message}}</div>
    <form method="post">
        <input type="text" name="username" id="username" placeholder="请输入25个字符内的用户名" required>
        <input type="password" name="password" id="password" placeholder="请输入密码" required>
        <div class="password-confirm">
            <input type="password" name="confirm" id="confirm" placeholder="请确认密码 " required>
            <span id="password-status" class="password-status hidden"></span>
        </div>
        <input type="text" name="phone" id="phone" placeholder="请输入你的电话号码(11位数)" required>
        <script>
                window.onload = function (){
                    var phone = document.getElementById('phone');
                    phone.onblur = function (){
                        var str = this.value;
                        if (str != ""){
                            var reg = /^1[3-9]\d{9}$/;
                            if (reg.test(str)){

                            }
                            else {
                                alert("号码不正确！")
                                this.value="";
                            }
                            console.log(str);
                        }
                    }
                }
        </script>
        <button type="submit">注册</button>
    </form>
</div>

<script>
        const message = document.getElementById('message').innerHTML
        alert(message)
</script>
</body>
</html>
